﻿namespace Microsoft.SharePoint.Client
{
    using System;
    using System.ComponentModel;

    [ScriptType("SP.ListTemplate", ServerTypeId="{d772ecd1-daa3-4cb1-9ea1-feea1e383fb2}")]
    public class ListTemplate : ClientObject
    {
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ListTemplate(ClientRuntimeContext Context, ObjectPath ObjectPath) : base(Context, ObjectPath)
        {
        }

        protected override bool InitOnePropertyFromJson(string peekedName, JsonReader reader)
        {
            bool flag = base.InitOnePropertyFromJson(peekedName, reader);
            if (!flag)
            {
                switch (peekedName)
                {
                    case "Name":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Name"] = reader.ReadString();
                        return flag;

                    case "InternalName":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["InternalName"] = reader.ReadString();
                        return flag;

                    case "Description":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Description"] = reader.ReadString();
                        return flag;

                    case "BaseType":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["BaseType"] = reader.ReadEnum<Microsoft.SharePoint.Client.BaseType>();
                        return flag;

                    case "FeatureId":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["FeatureId"] = reader.ReadGuid();
                        return flag;

                    case "ListTemplateTypeKind":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["ListTemplateTypeKind"] = reader.ReadInt32();
                        return flag;

                    case "ImageUrl":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["ImageUrl"] = reader.ReadString();
                        return flag;

                    case "Hidden":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Hidden"] = reader.ReadBoolean();
                        return flag;

                    case "Unique":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Unique"] = reader.ReadBoolean();
                        return flag;

                    case "OnQuickLaunch":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["OnQuickLaunch"] = reader.ReadBoolean();
                        return flag;

                    case "AllowsFolderCreation":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["AllowsFolderCreation"] = reader.ReadBoolean();
                        return flag;

                    case "IsCustomTemplate":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["IsCustomTemplate"] = reader.ReadBoolean();
                        return flag;
                }
            }
            return flag;
        }

        [Remote]
        public bool AllowsFolderCreation
        {
            get
            {
                base.CheckUninitializedProperty("AllowsFolderCreation");
                return (bool) base.ObjectData.Properties["AllowsFolderCreation"];
            }
        }

        [Remote]
        public Microsoft.SharePoint.Client.BaseType BaseType
        {
            get
            {
                base.CheckUninitializedProperty("BaseType");
                return (Microsoft.SharePoint.Client.BaseType) base.ObjectData.Properties["BaseType"];
            }
        }

        [Remote]
        public string Description
        {
            get
            {
                base.CheckUninitializedProperty("Description");
                return (string) base.ObjectData.Properties["Description"];
            }
        }

        [Remote]
        public Guid FeatureId
        {
            get
            {
                base.CheckUninitializedProperty("FeatureId");
                return (Guid) base.ObjectData.Properties["FeatureId"];
            }
        }

        [Remote]
        public bool Hidden
        {
            get
            {
                base.CheckUninitializedProperty("Hidden");
                return (bool) base.ObjectData.Properties["Hidden"];
            }
        }

        [Remote]
        public string ImageUrl
        {
            get
            {
                base.CheckUninitializedProperty("ImageUrl");
                return (string) base.ObjectData.Properties["ImageUrl"];
            }
        }

        [Remote]
        public string InternalName
        {
            get
            {
                base.CheckUninitializedProperty("InternalName");
                return (string) base.ObjectData.Properties["InternalName"];
            }
        }

        [Remote]
        public bool IsCustomTemplate
        {
            get
            {
                base.CheckUninitializedProperty("IsCustomTemplate");
                return (bool) base.ObjectData.Properties["IsCustomTemplate"];
            }
        }

        [Remote]
        public int ListTemplateTypeKind
        {
            get
            {
                base.CheckUninitializedProperty("ListTemplateTypeKind");
                return (int) base.ObjectData.Properties["ListTemplateTypeKind"];
            }
        }

        [Remote]
        public string Name
        {
            get
            {
                base.CheckUninitializedProperty("Name");
                return (string) base.ObjectData.Properties["Name"];
            }
        }

        [Remote]
        public bool OnQuickLaunch
        {
            get
            {
                base.CheckUninitializedProperty("OnQuickLaunch");
                return (bool) base.ObjectData.Properties["OnQuickLaunch"];
            }
        }

        [Remote]
        public bool Unique
        {
            get
            {
                base.CheckUninitializedProperty("Unique");
                return (bool) base.ObjectData.Properties["Unique"];
            }
        }
    }
}

